#ifndef HELMETLEDS_H
#define HELMETLEDS_H

#include "HelmetSystemConfig.h"

/**************************************************************************************
	Definitions
**************************************************************************************/
#define PORTE_LED_MASK ( BIT_4 | BIT_3 | BIT_2 )
#define PORTG_LED_MASK ( BIT_13 | BIT_12 | BIT_14 )

#define ClearHEARTBEAT() mPORTEClearBits( BIT_4 )
#define ClearGPSLED() mPORTEClearBits( BIT_3 )
#define ClearAtomLED() mPORTEClearBits( BIT_2 )
#define Clear0GDLED() mPORTGClearBits( BIT_13 )
#define ClearErr1LED() mPORTGClearBits( BIT_12 )
#define ClearErr2LED() mPORTGClearBits( BIT_14 )

#define SetHEARTBEAT() mPORTESetBits( BIT_4 )
#define SetGPSLED() mPORTESetBits( BIT_3 )
#define SetAtomLED() mPORTESetBits( BIT_2 )
#define Set0GDLED() mPORTGSetBits( BIT_13 )
#define SetErr1LED() mPORTGSetBits( BIT_12 )
#define SetErr2LED() mPORTGSetBits( BIT_14 )

#define ToggleHEARTBEAT() mPORTEToggleBits( BIT_4 )
#define ToggleGPSLED() mPORTEToggleBits( BIT_3 )
#define ToggleAtomLED() mPORTEToggleBits( BIT_2 )
#define Toggle0GDLED() mPORTGToggleBits( BIT_13 )
#define ToggleErr1LED() mPORTGToggleBits( BIT_12 )
#define ToggleErr2LED() mPORTGToggleBits( BIT_14 )

/**************************************************************************************
	Function Prototypes
**************************************************************************************/
void ConfigLEDs( void );
void ClearAllLEDs( void );

/**************************************************************************************
	Functions
**************************************************************************************/
void ConfigLEDs() {
	mPORTESetPinsDigitalOut( PORTE_LED_MASK );
	mPORTGSetPinsDigitalOut( PORTG_LED_MASK );
	ClearAllLEDs();
}

void ClearAllLEDs() {
	ClearHEARTBEAT();
	ClearGPSLED();
	ClearAtomLED();
	Clear0GDLED();
	ClearErr1LED();
	ClearErr2LED();
}

#endif